/*
 * @Author: wangming
 * @Date: 2020-09-22 11:21:40
 * @LastEditors: your name
 * @LastEditTime: 2021-11-19 14:11:38
 * @Description: file content
 */
export const beforeunload = {
  created () {
    window.addEventListener('beforeunload', this.beforeunloadFun)
  },
  destroyed () {
    window.removeEventListener('beforeunload', this.beforeunloadFun)
  },
  methods: {
    beforeunloadFun (event) {
      if (event) {
        event.returnValue = '关闭提示'
      }
    }
  }
}
